<template>
  <el-select v-model="value" value-key="code" placeholder="请选择" @change="changeValue($event)" clearable>
    <el-option
      v-for="item in chargingType"
      :key="item.code"
      :label="item.chargingType"
      :value="item"
    />
  </el-select>
</template>
<script>
export default {
  data() {
    return {
      value: '',
      chargingType: [],
      dictType: {
        types: 'queryChargingType'
      }
    }
  },
  methods: {
    changeValue(e) {
      this.$emit('queryChargingType', this.value)
    },
    setSelectValue(value) {
      this.value = value
    },
    initDict(dictData) {
      this.value = ''
      this.chargingType = dictData
    }
  }
}
</script>
